//
//  UIButton+Extension.swift
//  yanXiangWeiBo
//
//  Created by 颜祥 on 15/12/24.
//  Copyright © 2015年 yanxiang. All rights reserved.
//

import UIKit

extension UIButton
{
    // 便利构造函数
   convenience init(imageName: String, fontSize: CGFloat, title: String)
    {
        self.init()
        
        // 设置图片
        setImage(UIImage(named: imageName), forState: UIControlState.Normal)
        
        // 设置标题
        setTitle(title, forState: UIControlState.Normal)
        
        // 设置标题大小
        titleLabel?.font = UIFont.systemFontOfSize(fontSize)
        
        // 设置文字颜色
        setTitleColor(UIColor.lightGrayColor(), forState: UIControlState.Normal)
        
        
    }
    
}
